package com.kanq.service.designpatterns.strategy;

/**
 * @Author cheng jun
 * @Description:
 * @Date 2021/7/13 21:39
 */
public class Dog implements CompareTo<Dog> {

    private int weight;

    public Dog(int weight) {
        this.weight = weight;
    }

    @Override
    public int compareTo(Dog dog) {
        if (this.weight > dog.weight) {
            return 1;
        } else if (this.weight < dog.weight) {
            return -1;
        } else {
            return 0;
        }
    }

    @Override
    public String toString() {
        return "Dog{" +
                "weight=" + weight +
                '}';
    }
}
